<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Modular arithmetic</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Modular_arithmetic"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Modular_arithmetic rootpage-Modular_arithmetic skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Modular arithmetic</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">This article is about the concept that uses the "<i><span class="texhtml mvar" style="font-style:italic;">a</span> (mod <span class="texhtml mvar" style="font-style:italic;">m</span>)</i>" notation. For the binary operation <i>mod(<span class="texhtml mvar" style="font-style:italic;">a,m</span>)</i>, see <a href="Modulo" title="Modulo">Modulo</a>.</div>
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p>In <a href="Mathematics" title="Mathematics">mathematics</a>, <b>modular arithmetic</b> is a system of <a href="Arithmetic" title="Arithmetic">arithmetic</a> operations for <a href="Integer" title="Integer">integers</a>, other than the usual ones from elementary arithmetic, where numbers "wrap around" when reaching a certain value, called the <b>modulus</b>. The modern approach to modular arithmetic was developed by <a href="Carl_Friedrich_Gauss" title="Carl Friedrich Gauss">Carl Friedrich Gauss</a> in his book <i><a href="Disquisitiones_Arithmeticae" title="Disquisitiones Arithmeticae">Disquisitiones Arithmeticae</a></i>, published in 1801.
</p><p>A familiar example of modular arithmetic is the hour hand on a <a href="12-hour_clock" title="12-hour clock">12-hour clock</a>. If the hour hand points to 7 now, then 8 hours later it will point to 3. Ordinary addition would result in <span class="nowrap">7 + 8 = 15</span>, but 15 reads as 3 on the clock face. This is because the hour hand makes one rotation every 12 hours and the hour number starts over when the hour hand passes 12. We say that 15 is <i>congruent</i> to 3 modulo 12, written 15 ≡ 3 (mod 12), so that 7 + 8 ≡ 3 (mod 12).
</p><p>Similarly, if one starts at 12 and waits 8 hours, the hour hand will be at 8. If one instead waited twice as long, 16 hours, the hour hand would be on 4. This can be written as 2 × 8 ≡ 4 (mod 12). Note that after a wait of exactly 12 hours, the hour hand will always be right where it was before, so 12 acts the same as zero, thus 12 ≡ 0 (mod 12).
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Congruence">Congruence</h2></div>
<p>Given an <a href="Integer" title="Integer">integer</a> <span class="texhtml"><i>m</i> ≥ 1</span>, called a <b>modulus</b>, two integers <span class="texhtml mvar" style="font-style:italic;">a</span> and <span class="texhtml mvar" style="font-style:italic;">b</span> are said to be <b>congruent</b> modulo <span class="texhtml mvar" style="font-style:italic;">m</span>, if <span class="texhtml mvar" style="font-style:italic;">m</span> is a <a href="Divisor" title="Divisor">divisor</a> of their difference; that is, if there is an integer <span class="texhtml"><i>k</i></span> such that
</p>
<dl><dd><span class="texhtml"><i>a</i> − <i>b</i> = <i>k m</i></span>.</dd></dl>
<p>Congruence modulo <span class="texhtml mvar" style="font-style:italic;">m</span> is a <a href="Congruence_relation" title="Congruence relation">congruence relation</a>, meaning that it is an <a href="Equivalence_relation" title="Equivalence relation">equivalence relation</a> that is compatible with <a href="Addition" title="Addition">addition</a>, <a href="Subtraction" title="Subtraction">subtraction</a>, and <a href="Multiplication" title="Multiplication">multiplication</a>. Congruence modulo <span class="texhtml mvar" style="font-style:italic;">m</span> is denoted by
</p>
<dl><dd><span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span>.</dd></dl>
<p>The parentheses mean that <span class="texhtml">(mod <i>m</i>)</span> applies to the entire equation, not just to the right-hand side (here, <span class="texhtml mvar" style="font-style:italic;">b</span>).
</p><p>This notation is not to be confused with the notation <span class="texhtml"><i>b</i> mod <i>m</i></span> (without parentheses), which refers to the remainder of <span class="texhtml"><i>b</i></span> when divided by <span class="texhtml"><i>m</i></span>, known as the <a href="Modulo" title="Modulo">modulo</a> operation: that is, <span class="texhtml"><i>b</i> mod <i>m</i></span> denotes the unique integer <span class="texhtml mvar" style="font-style:italic;">r</span> such that <span class="texhtml">0 ≤ <i>r</i> < <i>m</i></span> and <span class="texhtml"><i>r</i> ≡ <i>b</i> (mod <i>m</i>)</span>.
</p><p>The congruence relation may be rewritten as
</p>
<dl><dd><span class="texhtml"><i>a</i> = <i>k m</i> + <i>b</i></span>,</dd></dl>
<p>explicitly showing its relationship with <a href="Euclidean_division" title="Euclidean division">Euclidean division</a>. However, the <span class="texhtml"><i>b</i></span> here need not be the remainder in the division of <span class="texhtml"><i>a</i></span> by <span class="texhtml"><i>m</i>.</span> Rather, <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span> asserts that <span class="texhtml"><i>a</i></span> and <span class="texhtml"><i>b</i></span> have the same <a href="Remainder" title="Remainder">remainder</a> when divided by <span class="texhtml"><i>m</i></span>. That is,
</p>
<dl><dd><span class="texhtml"><i>a</i> = <i>p m</i> + <i>r</i></span>,</dd>
<dd><span class="texhtml"><i>b</i> = <i>q m</i> + <i>r</i></span>,</dd></dl>
<p>where <span class="texhtml">0 ≤ <i>r</i> < <i>m</i></span> is the common remainder. We recover the previous relation (<span class="texhtml"><i>a</i> − <i>b</i> = <i>k m</i></span>) by subtracting these two expressions and setting <span class="texhtml"><i>k</i> = <i>p</i> − <i>q</i>.</span>
</p><p>Because the congruence modulo <span class="texhtml mvar" style="font-style:italic;">m</span> is defined by the <a href="Divisor#Further_notions_and_facts" title="Divisor">divisibility</a> by <span class="texhtml mvar" style="font-style:italic;">m</span> and because <span class="texhtml">−1</span> is a <a href="Unit_(ring_theory)#Integer_ring" title="Unit (ring theory)">unit</a> in the ring of integers, a number is divisible by <span class="texhtml">−<i>m</i></span> exactly if it is divisible by <span class="texhtml mvar" style="font-style:italic;">m</span>.
This means that every non-zero integer <span class="texhtml mvar" style="font-style:italic;">m</span> may be taken as modulus.
</p>
<div class="mw-heading mw-heading3"><h3 id="Examples">Examples</h3></div>
<p>In modulus 12, one can assert that:
</p>
<dl><dd><span class="texhtml">38 ≡ 14 (mod 12)</span></dd></dl>
<p>because the difference is <span class="texhtml">38 − 14 = 24 = 2 × 12</span>, a multiple of <span class="texhtml">12</span>. Equivalently, <span class="texhtml">38</span> and <span class="texhtml">14</span> have the same remainder <span class="texhtml">2</span> when divided by <span class="texhtml">12</span>.
</p><p>The definition of congruence also applies to negative values. For example:
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}2&\equiv -3{\pmod {5}}\\-8&\equiv {\phantom {+}}7{\pmod {5}}\\-3&\equiv -8{\pmod {5}}.\end{aligned}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true">
<mtr>
<mtd>
<mn>2</mn>
</mtd>
<mtd>
<mi></mi>
<mo>≡<!-- ≡ --></mo>
<mo>−<!-- − --></mo>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mspace width="1em"></mspace>
<mo stretchy="false">(</mo>
<mi>mod</mi>
<mspace width="0.333em"></mspace>
<mn>5</mn>
<mo stretchy="false">)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>−<!-- − --></mo>
<mn>8</mn>
</mtd>
<mtd>
<mi></mi>
<mo>≡<!-- ≡ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mphantom>
<mo>+</mo>
</mphantom>
</mrow>
</mrow>
<mn>7</mn>
<mrow class="MJX-TeXAtom-ORD">
<mspace width="1em"></mspace>
<mo stretchy="false">(</mo>
<mi>mod</mi>
<mspace width="0.333em"></mspace>
<mn>5</mn>
<mo stretchy="false">)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>−<!-- − --></mo>
<mn>3</mn>
</mtd>
<mtd>
<mi></mi>
<mo>≡<!-- ≡ --></mo>
<mo>−<!-- − --></mo>
<mn>8</mn>
<mrow class="MJX-TeXAtom-ORD">
<mspace width="1em"></mspace>
<mo stretchy="false">(</mo>
<mi>mod</mi>
<mspace width="0.333em"></mspace>
<mn>5</mn>
<mo stretchy="false">)</mo>
</mrow>
<mo>.</mo>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{aligned}2&\equiv -3{\pmod {5}}\\-8&\equiv {\phantom {+}}7{\pmod {5}}\\-3&\equiv -8{\pmod {5}}.\end{aligned}}}</annotation>
</semantics>
</math></span><img src="./96427ea4e4951105b655e6af2c127031c733132e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -4.005ex; width:21.284ex; height:9.176ex;" alt="{\displaystyle {\begin{aligned}2&\equiv -3{\pmod {5}}\\-8&\equiv {\phantom {+}}7{\pmod {5}}\\-3&\equiv -8{\pmod {5}}.\end{aligned}}}" loading="lazy"></span></dd></dl>
<div class="mw-heading mw-heading2"><h2 id="Basic_properties">Basic properties</h2></div>
<p>
The congruence relation satisfies all the conditions of an <a href="Equivalence_relation" title="Equivalence relation">equivalence relation</a>:
</p>
<ul><li>Reflexivity: <span class="texhtml"><i>a</i> ≡ <i>a</i> (mod <i>m</i>)</span></li>
<li>Symmetry: <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span> if <span class="texhtml"><i>b</i> ≡ <i>a</i> (mod <i>m</i>)</span>.</li>
<li>Transitivity: If <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span> and <span class="texhtml"><i>b</i> ≡ <i>c</i> (mod <i>m</i>)</span>, then <span class="texhtml"><i>a</i> ≡ <i>c</i> (mod <i>m</i>)</span></li></ul>
<p>If <span class="texhtml"><i>a</i><sub>1</sub> ≡ <i>b</i><sub>1</sub> (mod <i>m</i>)</span> and <span class="texhtml"><i>a</i><sub>2</sub> ≡ <i>b</i><sub>2</sub> (mod <i>m</i>)</span>, or if <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span>, then:<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li><span class="texhtml"><i>a</i> + <i>k</i> ≡ <i>b</i> + <i>k</i> (mod <i>m</i>)</span> for any integer <span class="texhtml"><i>k</i></span> (compatibility with translation)</li>
<li><span class="texhtml"><i>k a</i> ≡ <i>k b</i> (mod <i>m</i>)</span> for any integer <span class="texhtml"><i>k</i></span> (compatibility with scaling)</li>
<li><span class="texhtml"><i>k a</i> ≡ <i>k b</i> (mod <i>k m</i>)</span> for any integer <span class="texhtml"><i>k</i></span></li>
<li><span class="texhtml"><i>a</i><sub>1</sub> + <i>a</i><sub>2</sub> ≡ <i>b</i><sub>1</sub> + <i>b</i><sub>2</sub> (mod <i>m</i>)</span> (compatibility with addition)</li>
<li><span class="texhtml"><i>a</i><sub>1</sub> − <i>a</i><sub>2</sub> ≡ <i>b</i><sub>1</sub> − <i>b</i><sub>2</sub> (mod <i>m</i>)</span> (compatibility with subtraction)</li>
<li><span class="texhtml"><i>a</i><sub>1</sub> <i>a</i><sub>2</sub> ≡ <i>b</i><sub>1</sub> <i>b</i><sub>2</sub> (mod <i>m</i>)</span> (compatibility with multiplication)</li>
<li><span class="texhtml"><i>a</i><sup><i>k</i></sup> ≡ <i>b</i><sup><i>k</i></sup> (mod <i>m</i>)</span> for any non-negative integer <span class="texhtml"><i>k</i></span> (compatibility with exponentiation)</li>
<li><span class="texhtml"><i>p</i>(<i>a</i>) ≡ <i>p</i>(<i>b</i>) (mod <i>m</i>)</span>, for any <a href="Polynomial" title="Polynomial">polynomial</a> <span class="texhtml"><i>p</i>(<i>x</i>)</span> with integer coefficients (compatibility with polynomial evaluation)</li></ul>
<p>If <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span>, then it is generally false that <span class="texhtml"><i>k<sup>a</sup></i> ≡ <i>k<sup>b</sup></i> (mod <i>m</i>)</span>. However, the following is true:
</p>
<ul><li>If <span class="texhtml"><i>c</i> ≡ <i>d</i> (mod <i>φ</i>(<i>m</i>)),</span> where <span class="texhtml"><i>φ</i></span> is <a href="Euler's_totient_function" title="Euler's totient function">Euler's totient function</a>, then <span class="texhtml"><i>a</i><sup><i>c</i></sup> ≡ <i>a</i><sup><i>d</i></sup> (mod <i>m</i>)</span>—provided that <span class="texhtml"><i>a</i></span> is <a href="Coprime" class="mw-redirect" title="Coprime">coprime</a> with <span class="texhtml"><i>m</i></span>.</li></ul>
<p>For cancellation of common terms, we have the following rules:
</p>
<ul><li>If <span class="texhtml"><i>a</i> + <i>k</i> ≡ <i>b</i> + <i>k</i> (mod <i>m</i>)</span>, where <span class="texhtml"><i>k</i></span> is any integer, then <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span>.</li>
<li>If <span class="texhtml"><i>k a</i> ≡ <i>k b</i> (mod <i>m</i>)</span> and <span class="texhtml"><i>k</i></span> is coprime with <span class="texhtml"><i>m</i></span>, then <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span>.</li>
<li>If <span class="texhtml"><i>k a</i> ≡ <i>k b</i> (mod <i>k m</i>)</span> and <span class="texhtml"><i>k</i> ≠ 0</span>, then <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span>.</li></ul>
<p>The last rule can be used to move modular arithmetic into division. If <span class="texhtml"><i>b</i></span> divides <span class="texhtml"><i>a</i></span>, then <span class="texhtml">(<i>a</i>/<i>b</i>) mod <i>m</i> = (<i>a</i> mod <i>b m</i>) / <i>b</i></span>.
</p><p>The <a href="Modular_multiplicative_inverse" title="Modular multiplicative inverse">modular multiplicative inverse</a> is defined by the following rules:
</p>
<ul><li>Existence: There exists an integer denoted <span class="texhtml"><i>a</i><sup>−1</sup></span> such that <span class="texhtml"><i>aa</i><sup>−1</sup> ≡ 1 (mod <i>m</i>)</span> if and only if <span class="texhtml"><i>a</i></span> is coprime with <span class="texhtml"><i>m</i></span>. This integer <span class="texhtml"><i>a</i><sup>−1</sup></span> is called a <i>modular multiplicative inverse</i> of <span class="texhtml mvar" style="font-style:italic;">a</span> modulo <span class="texhtml"><i>m</i></span>.</li>
<li>If <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span> and <span class="texhtml"><i>a</i><sup>−1</sup></span> exists, then <span class="texhtml"><i>a</i><sup>−1</sup> ≡ <i>b</i><sup>−1</sup> (mod <i>m</i>)</span> (compatibility with multiplicative inverse, and, if <span class="texhtml"><i>a</i> = <i>b</i></span>, uniqueness modulo <span class="texhtml"><i>m</i></span>).</li>
<li>If <span class="texhtml"><i>ax</i> ≡ <i>b</i> (mod <i>m</i>)</span> and <span class="texhtml"><i>a</i></span> is coprime to <span class="texhtml"><i>m</i></span>, then the solution to this linear congruence is given by <span class="texhtml"><i>x</i> ≡ <i>a</i><sup>−1</sup><i>b</i> (mod <i>m</i>)</span>.</li></ul>
<p>The multiplicative inverse <span class="texhtml"><i>x</i> ≡ <i>a</i><sup>−1</sup> (mod <i>m</i>)</span> may be efficiently computed by solving <a href="B%C3%A9zout's_identity" title="Bézout's identity">Bézout's equation</a> <span class="texhtml"><i>a x</i> + <i>m y</i> = 1</span> for <span class="texhtml"><i>x</i></span>, <span class="texhtml"><i>y</i></span>, by using the <a href="Extended_Euclidean_algorithm" title="Extended Euclidean algorithm">Extended Euclidean algorithm</a>.
</p><p>In particular, if <span class="texhtml"><i>p</i></span> is a prime number, then <span class="texhtml"><i>a</i></span> is coprime with <span class="texhtml"><i>p</i></span> for every <span class="texhtml"><i>a</i></span> such that <span class="texhtml">0 < <i>a</i> < <i>p</i></span>; thus a multiplicative inverse exists for all <span class="texhtml"><i>a</i></span> that is not congruent to zero modulo <span class="texhtml"><i>p</i></span>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Advanced_properties">Advanced properties</h2></div>
<p>Some of the more advanced properties of congruence relations are the following:
</p>
<ul><li><a href="Fermat's_little_theorem" title="Fermat's little theorem">Fermat's little theorem</a>: If <span class="texhtml"><i>p</i></span> is prime and does not divide <span class="texhtml"><i>a</i></span>, then <span class="texhtml"><i>a</i><span style="padding-left:0.12em;"><sup><i>p</i>−1</sup></span> ≡ 1 (mod <i>p</i>)</span>.</li>
<li><a href="Euler's_theorem" title="Euler's theorem">Euler's theorem</a>: If <span class="texhtml"><i>a</i></span> and <span class="texhtml"><i>m</i></span> are coprime, then <span class="texhtml"><i>a</i><span style="padding-left:0.12em;"><sup><i>φ</i>(<i>m</i>)</sup></span> ≡ 1 (mod <i>m</i>)</span>, where <span class="texhtml"><i>φ</i></span> is <a href="Euler's_totient_function" title="Euler's totient function">Euler's totient function</a>.</li>
<li>A simple consequence of Fermat's little theorem is that if <span class="texhtml"><i>p</i></span> is prime, then <span class="texhtml"><i>a</i><sup>−1</sup> ≡ <i>a</i><span style="padding-left:0.12em;"><sup><i>p</i>−2</sup></span> (mod <i>p</i>)</span> is the multiplicative inverse of <span class="texhtml">0 < <i>a</i> < <i>p</i></span>. More generally, from Euler's theorem, if <span class="texhtml"><i>a</i></span> and <span class="texhtml"><i>m</i></span> are coprime, then <span class="texhtml"><i>a</i><span style="padding-left:0.12em;"><sup>−1</sup></span> ≡ <i>a</i><span style="padding-left:0.12em;"><sup><i>φ</i>(<i>m</i>)−1</sup></span> (mod <i>m</i>)</span>. Hence, if <span class="texhtml"><i>ax</i> ≡ <i>1</i> (mod <i>m</i>)</span>, then <span class="texhtml"><i>x</i> ≡ <i>a</i><span style="padding-left:0.12em;"><sup><i>φ</i>(<i>m</i>)−1</sup></span> (mod <i>m</i>)</span>.</li>
<li>Another simple consequence is that if <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>φ</i>(<i>m</i>))</span>, where <span class="texhtml"><i>φ</i></span> is Euler's totient function, then <span class="texhtml"><i>k</i><sup><i>a</i></sup> ≡ <i>k</i><sup><i>b</i></sup> (mod <i>m</i>)</span> provided <span class="texhtml"><i>k</i></span> is <a href="Coprime" class="mw-redirect" title="Coprime">coprime</a> with <span class="texhtml"><i>m</i></span>.</li>
<li><a href="Wilson's_theorem" title="Wilson's theorem">Wilson's theorem</a>: <span class="texhtml"><i>p</i></span> is prime if and only if <span class="texhtml">(<i>p</i> − 1)! ≡ −1 (mod <i>p</i>)</span>.</li>
<li><a href="Chinese_remainder_theorem" title="Chinese remainder theorem">Chinese remainder theorem</a>: For any <span class="texhtml"><i>a</i></span>, <span class="texhtml"><i>b</i></span> and coprime <span class="texhtml"><i>m</i></span>, <span class="texhtml"><i>n</i></span>, there exists a unique <span class="texhtml"><i>x</i> (mod <i>mn</i>)</span> such that <span class="texhtml"><i>x</i> ≡ <i>a</i> (mod <i>m</i>)</span> and <span class="texhtml"><i>x</i> ≡ <i>b</i> (mod <i>n</i>)</span>. In fact, <span class="texhtml"><i>x</i> ≡ <i>b m</i><sub><i>n</i></sub><sup>−1</sup> <i>m</i> + <i>a n</i><sub><i>m</i></sub><sup>−1</sup> <i>n</i> (mod <i>mn</i>)</span> where <span class="texhtml"><i>m</i><sub><i>n</i></sub><sup>−1</sup></span> is the inverse of <span class="texhtml"><i>m</i></span> modulo <span class="texhtml"><i>n</i></span> and <span class="texhtml"><i>n</i><sub><i>m</i></sub><sup>−1</sup></span> is the inverse of <span class="texhtml"><i>n</i></span> modulo <span class="texhtml"><i>m</i></span>.</li>
<li><a href="Lagrange's_theorem_(number_theory)" title="Lagrange's theorem (number theory)">Lagrange's theorem</a>: If <span class="texhtml"><i>p</i></span> is prime and <span class="texhtml"><i>f</i> (<i>x</i>) = <i>a</i><sub>0</sub> <i>x</i><sup><i>d</i></sup> + ... + <i>a</i><sub><i>d</i></sub></span> is a <a href="Polynomial" title="Polynomial">polynomial</a> with integer coefficients such that <span class="texhtml mvar" style="font-style:italic;">p</span> is not a divisor of <span class="texhtml"><i>a</i><sub>0</sub></span>, then the congruence <span class="texhtml"><i>f</i> (<i>x</i>) ≡ 0 (mod <i>p</i>)</span> has at most <span class="texhtml"><i>d</i></span> non-congruent solutions.</li>
<li><a href="Primitive_root_modulo_n" title="Primitive root modulo n">Primitive root modulo <span class="texhtml"><i>m</i></span></a>: A number <span class="texhtml"><i>g</i></span> is a primitive root modulo <span class="texhtml"><i>m</i></span> if, for every integer <span class="texhtml"><i>a</i></span> coprime to <span class="texhtml"><i>m</i></span>, there is an integer <span class="texhtml"><i>k</i></span> such that <span class="texhtml"><i>g</i><sup><i>k</i></sup> ≡ <i>a</i> (mod <i>m</i>)</span>. A primitive root modulo <span class="texhtml"><i>m</i></span> exists if and only if <span class="texhtml"><i>m</i></span> is equal to <span class="texhtml">2, 4, <i>p</i><sup><i>k</i></sup></span> or <span class="texhtml"> 2<i>p</i><sup><i>k</i></sup></span>, where <span class="texhtml"><i>p</i></span> is an odd prime number and <span class="texhtml"><i>k</i></span> is a positive integer. If a primitive root modulo <span class="texhtml"><i>m</i></span> exists, then there are exactly <span class="texhtml"><i>φ</i>(<i>φ</i>(<i>m</i>))</span> such primitive roots, where <span class="texhtml"><i>φ</i></span> is the Euler's totient function.</li>
<li><a href="Quadratic_residue" title="Quadratic residue">Quadratic residue</a>: An integer <span class="texhtml"><i>a</i></span> is a quadratic residue modulo <span class="texhtml"><i>m</i></span>, if there exists an integer <span class="texhtml"><i>x</i></span> such that <span class="texhtml"><i>x</i><sup>2</sup> ≡ <i>a</i> (mod <i>m</i>)</span>. <a href="Euler's_criterion" title="Euler's criterion">Euler's criterion</a> asserts that, if <span class="texhtml"><i>p</i></span> is an odd prime, and <span class="texhtml mvar" style="font-style:italic;">a</span> is not a multiple of <span class="texhtml mvar" style="font-style:italic;">p</span>, then <span class="texhtml"><i>a</i></span> is a quadratic residue modulo <span class="texhtml"><i>p</i></span> if and only if
<dl><dd><span class="texhtml"><i>a</i><span style="padding-left:0.12em;"><sup>(<i>p</i>−1)/2</sup></span> ≡ 1 (mod <i>p</i>)</span>.</dd></dl></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Congruence_classes">Congruence classes </h2></div>
<p>The congruence relation is an <a href="Equivalence_relation" title="Equivalence relation">equivalence relation</a>. The <a href="Equivalence_class" title="Equivalence class">equivalence class</a> modulo <span class="texhtml mvar" style="font-style:italic;">m</span> of an integer <span class="texhtml"><i>a</i></span> is the set of all integers of the form <span class="texhtml"><i>a</i> + <i>k m</i></span>, where <span class="texhtml mvar" style="font-style:italic;">k</span> is any integer. It is called the <b>congruence class</b> or <b>residue class</b> of <span class="texhtml"><i>a</i></span> modulo <span class="texhtml"><i>m</i></span>, and may be denoted <span class="texhtml">(<i>a</i> mod <i>m</i>)</span>, or as <span class="texhtml"><span style="text-decoration:overline;"><i>a</i></span></span> or <span class="texhtml">[<i>a</i>]</span> when the modulus <span class="texhtml"><i>m</i></span> is known from the context.
</p><p>Each residue class modulo <span class="texhtml"><i>m</i></span> contains exactly one integer in the range <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0,...,|m|-1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>0</mn>
<mo>,</mo>
<mo>.</mo>
<mo>.</mo>
<mo>.</mo>
<mo>,</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 0,...,|m|-1}</annotation>
</semantics>
</math></span><img src="./c16b9b50a1528ea7008e29033c02f770ed79678c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.669ex; height:2.843ex;" alt="{\displaystyle 0,...,|m|-1}" loading="lazy"></span>. Thus, these <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle |m|}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo stretchy="false">|</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle |m|}</annotation>
</semantics>
</math></span><img src="./f9aa0b9c6f0a110ae299bf81e924412842ce2b12.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:3.334ex; height:2.843ex;" alt="{\displaystyle |m|}" loading="lazy"></span> integers are <a href="Representative_(mathematics)" class="mw-redirect" title="Representative (mathematics)">representatives</a> of their respective residue classes.
</p><p>It is generally easier to work with integers than sets of integers; that is, the representatives most often considered, rather than their residue classes.
</p><p>Consequently, <span class="texhtml">(<i>a</i> mod <i>m</i>)</span> denotes generally the unique integer <span class="texhtml mvar" style="font-style:italic;">r</span> such that <span class="texhtml">0 ≤ <i>r</i> < <i>m</i></span> and <span class="texhtml"><i>r</i> ≡ <i>a</i> (mod <i>m</i>)</span>; it is called the <b>residue</b> of <span class="texhtml"><i>a</i></span> modulo <span class="texhtml"><i>m</i></span>.
</p><p>In particular, <span class="texhtml">(<i>a</i> mod <i>m</i>) = (<i>b</i> mod <i>m</i>)</span> is equivalent to <span class="texhtml"><i>a</i> ≡ <i>b</i> (mod <i>m</i>)</span>, and this explains why "<span class="texhtml">=</span>" is often used instead of "<span class="texhtml">≡</span>" in this context.
</p>
<div class="mw-heading mw-heading2"><h2 id="Residue_systems">Residue systems</h2></div>
<p>Each residue class modulo <span class="texhtml"><i>m</i></span> may be represented by any one of its members, although we usually represent each residue class by the smallest nonnegative integer which belongs to that class<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> (since this is the proper remainder which results from division). Any two members of different residue classes modulo <span class="texhtml"><i>m</i></span> are incongruent modulo <span class="texhtml"><i>m</i></span>. Furthermore, every integer belongs to one and only one residue class modulo <span class="texhtml"><i>m</i></span>.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p><p>The set of integers <span class="texhtml">{0, 1, 2, ..., <i>m</i> − 1}</span> is called the <b>least residue system modulo <span class="texhtml"><i>m</i></span></b>. Any set of <span class="texhtml"><i>m</i></span> integers, no two of which are congruent modulo <span class="texhtml"><i>m</i></span>, is called a <b>complete residue system modulo <span class="texhtml"><i>m</i></span></b>.
</p><p>The least residue system is a complete residue system, and a complete residue system is simply a set containing precisely one <a href="Representative_(mathematics)" class="mw-redirect" title="Representative (mathematics)">representative</a> of each residue class modulo <span class="texhtml"><i>m</i></span>.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> For example, the least residue system modulo <span class="texhtml">4</span> is <span class="texhtml">{0, 1, 2, 3}</span>. Some other complete residue systems modulo <span class="texhtml">4</span> include:
</p>
<ul><li><span class="texhtml">{1, 2, 3, 4}</span></li>
<li><span class="texhtml">{13, 14, 15, 16}</span></li>
<li><span class="texhtml">{−2, −1, 0, 1}</span></li>
<li><span class="texhtml">{−13, 4, 17, 18}</span></li>
<li><span class="texhtml">{−5, 0, 6, 21}</span></li>
<li><span class="texhtml">{27, 32, 37, 42}</span></li></ul>
<p>Some sets that are <i>not</i> complete residue systems modulo 4 are:
</p>
<ul><li><span class="texhtml">{−5, 0, 6, 22}</span>, since <span class="texhtml">6</span> is congruent to <span class="texhtml">22</span> modulo <span class="texhtml">4</span>.</li>
<li><span class="texhtml">{5, 15}</span>, since a complete residue system modulo <span class="texhtml">4</span> must have exactly <span class="texhtml">4</span> incongruent residue classes.</li></ul>
<div class="mw-heading mw-heading3"><h3 id="Reduced_residue_systems">Reduced residue systems</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Reduced_residue_system" title="Reduced residue system">Reduced residue system</a></div>
<p>Given the <a href="Euler's_totient_function" title="Euler's totient function">Euler's totient function</a> <span class="texhtml"><i>φ</i>(<i>m</i>)</span>, any set of <span class="texhtml"><i>φ</i>(<i>m</i>)</span> integers that are <a href="Coprime_integers" title="Coprime integers">relatively prime</a> to <span class="texhtml"><i>m</i></span> and mutually incongruent under modulus <span class="texhtml"><i>m</i></span> is called a <b>reduced residue system modulo <span class="texhtml"><i>m</i></span></b>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> The set <span class="texhtml">{5, 15}</span> from above, for example, is an instance of a reduced residue system modulo 4.
</p>
<div class="mw-heading mw-heading3"><h3 id="Covering_systems">Covering systems</h3></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Covering_system" title="Covering system">Covering system</a></div>
<p>Covering systems represent yet another type of residue system that may contain residues with varying moduli.
</p>
<div class="mw-heading mw-heading2"><h2 id="Integers_modulo_m">Integers modulo <i>m</i></h2></div>
<p>In the context of this paragraph, the modulus <span class="texhtml"><i>m</i></span> is almost always taken as positive.
</p><p>The set of all <a href="#Congruence_classes">congruence classes</a> modulo <span class="texhtml"><i>m</i></span> is a <a href="Ring_(mathematics)" title="Ring (mathematics)">ring</a> called the <b>ring of integers modulo <span class="texhtml"><i>m</i></span></b>, and is denoted <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\textstyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\textstyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./0a08c684b0f13affb387daa9275f0f67512eda7c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\textstyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span>, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m}</annotation>
</semantics>
</math></span><img src="./8ba3ed3e693048c5108f9daf9164b2580ec21883.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.753ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m}" loading="lazy"></span>, or <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} _{m}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} _{m}}</annotation>
</semantics>
</math></span><img src="./5474379674b9a5fd1b1336571cbeacbe81212d34.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.225ex; height:2.509ex;" alt="{\displaystyle \mathbb {Z} _{m}}" loading="lazy"></span>.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
The ring <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> is fundamental to various branches of mathematics (see <i><a href="#Applications">§ Applications</a></i> below).
(In some parts of <a href="Number_theory" title="Number theory">number theory</a> the notation <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} _{m}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} _{m}}</annotation>
</semantics>
</math></span><img src="./5474379674b9a5fd1b1336571cbeacbe81212d34.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.225ex; height:2.509ex;" alt="{\displaystyle \mathbb {Z} _{m}}" loading="lazy"></span> is avoided because it can be confused with the set of <a href="P-adic_integer" class="mw-redirect" title="P-adic integer"><span class="texhtml"><i>m</i></span>-adic integers</a>.)
</p><p>For <span class="texhtml"><i>m</i> > 0</span> one has
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} =\left\{{\overline {a}}_{m}\mid a\in \mathbb {Z} \right\}=\left\{{\overline {0}}_{m},{\overline {1}}_{m},{\overline {2}}_{m},\ldots ,{\overline {m{-}1}}_{m}\right\}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mo>=</mo>
<mrow>
<mo>{</mo>
<mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>a</mi>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>∣<!-- ∣ --></mo>
<mi>a</mi>
<mo>∈<!-- ∈ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mrow>
<mo>}</mo>
</mrow>
<mo>=</mo>
<mrow>
<mo>{</mo>
<mrow>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>0</mn>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>1</mn>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>2</mn>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo>−<!-- − --></mo>
</mrow>
<mn>1</mn>
</mrow>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
</mrow>
<mo>}</mo>
</mrow>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} =\left\{{\overline {a}}_{m}\mid a\in \mathbb {Z} \right\}=\left\{{\overline {0}}_{m},{\overline {1}}_{m},{\overline {2}}_{m},\ldots ,{\overline {m{-}1}}_{m}\right\}.}</annotation>
</semantics>
</math></span><img src="./c7952b2b1d39f18594aa833834fa43668b47197f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:52.442ex; height:4.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} =\left\{{\overline {a}}_{m}\mid a\in \mathbb {Z} \right\}=\left\{{\overline {0}}_{m},{\overline {1}}_{m},{\overline {2}}_{m},\ldots ,{\overline {m{-}1}}_{m}\right\}.}" loading="lazy"></span></dd></dl>
<p>When <span class="texhtml"><i>m</i> = 1</span>, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> is the <a href="Zero_ring" title="Zero ring">zero ring</a>; when <span class="texhtml"><i>m</i> = 0</span>, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> is not an <a href="Empty_set" title="Empty set">empty set</a>; rather, it is <a href="Isomorphism" title="Isomorphism">isomorphic</a> to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./449494a083e0a1fda2b61c62b2f09b6bee4633dc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.55ex; height:2.176ex;" alt="{\displaystyle \mathbb {Z} }" loading="lazy"></span>, since <span class="texhtml"><span style="text-decoration:overline;"><i>a</i></span><sub>0</sub> = {<i>a</i>}</span>.
</p><p>Addition, subtraction, and multiplication are defined on <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> by the following rules:
</p>
<ul><li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\overline {a}}_{m}+{\overline {b}}_{m}={\overline {(a+b)}}_{m}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>a</mi>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>b</mi>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow>
<mo stretchy="false">(</mo>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\overline {a}}_{m}+{\overline {b}}_{m}={\overline {(a+b)}}_{m}}</annotation>
</semantics>
</math></span><img src="./7e1b0ab102f3d880d4e9417633cc1e1facf69dcd.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:20.413ex; height:3.843ex;" alt="{\displaystyle {\overline {a}}_{m}+{\overline {b}}_{m}={\overline {(a+b)}}_{m}}" loading="lazy"></span></li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\overline {a}}_{m}-{\overline {b}}_{m}={\overline {(a-b)}}_{m}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>a</mi>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>−<!-- − --></mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>b</mi>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow>
<mo stretchy="false">(</mo>
<mi>a</mi>
<mo>−<!-- − --></mo>
<mi>b</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\overline {a}}_{m}-{\overline {b}}_{m}={\overline {(a-b)}}_{m}}</annotation>
</semantics>
</math></span><img src="./6e1047bafa007e27ec6252c93f06006b24b7662e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:20.413ex; height:3.843ex;" alt="{\displaystyle {\overline {a}}_{m}-{\overline {b}}_{m}={\overline {(a-b)}}_{m}}" loading="lazy"></span></li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\overline {a}}_{m}{\overline {b}}_{m}={\overline {(ab)}}_{m}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>a</mi>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>b</mi>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow>
<mo stretchy="false">(</mo>
<mi>a</mi>
<mi>b</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\overline {a}}_{m}{\overline {b}}_{m}={\overline {(ab)}}_{m}.}</annotation>
</semantics>
</math></span><img src="./2cef0bc14b824350bf2593a5efffda2a0aa43c19.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:15.379ex; height:3.843ex;" alt="{\displaystyle {\overline {a}}_{m}{\overline {b}}_{m}={\overline {(ab)}}_{m}.}" loading="lazy"></span></li></ul>
<p>The properties given before imply that, with these operations, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> is a <a href="Commutative_ring" title="Commutative ring">commutative ring</a>. For example, in the ring <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /24\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mn>24</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /24\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6b575ee86953e53aa06382cd7289a13fcc2a4583.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.588ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /24\mathbb {Z} }" loading="lazy"></span>, one has
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\overline {12}}_{24}+{\overline {21}}_{24}={\overline {33}}_{24}={\overline {9}}_{24}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>12</mn>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>24</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>21</mn>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>24</mn>
</mrow>
</msub>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>33</mn>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>24</mn>
</mrow>
</msub>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>9</mn>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>24</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\overline {12}}_{24}+{\overline {21}}_{24}={\overline {33}}_{24}={\overline {9}}_{24}}</annotation>
</semantics>
</math></span><img src="./2816d2095bb867f0c38c120070bd87e5793d0f30.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:25.139ex; height:3.176ex;" alt="{\displaystyle {\overline {12}}_{24}+{\overline {21}}_{24}={\overline {33}}_{24}={\overline {9}}_{24}}" loading="lazy"></span></dd></dl>
<p>as in the arithmetic for the 24-hour clock.
</p><p>The notation <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> is used because this ring is the <a href="Quotient_ring" title="Quotient ring">quotient ring</a> of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./449494a083e0a1fda2b61c62b2f09b6bee4633dc.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.55ex; height:2.176ex;" alt="{\displaystyle \mathbb {Z} }" loading="lazy"></span> by the <a href="Ideal_(ring_theory)" title="Ideal (ring theory)">ideal</a> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./cb660446d851fca07d1cfdd36a71c022ad617d23.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:3.591ex; height:2.176ex;" alt="{\displaystyle m\mathbb {Z} }" loading="lazy"></span>, the set formed by all multiples of <span class="texhtml"><i>m</i></span>, i.e., all numbers <span class="texhtml"><i>k m</i></span> with <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k\in \mathbb {Z} .}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>k</mi>
<mo>∈<!-- ∈ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle k\in \mathbb {Z} .}</annotation>
</semantics>
</math></span><img src="./0829895a7f6a03b7e80aac56c7df6e277fd09cdb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.249ex; height:2.176ex;" alt="{\displaystyle k\in \mathbb {Z} .}" loading="lazy"></span>
</p><p>Under addition, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> is a <a href="Cyclic_group" title="Cyclic group">cyclic group</a>. All finite cyclic groups are isomorphic with <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span> for some <span class="texhtml mvar" style="font-style:italic;">m</span>.<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p><p>The ring of integers modulo <span class="texhtml"><i>m</i></span> is a <a href="Field_(mathematics)" title="Field (mathematics)">field</a>, i.e., every nonzero element has a <a href="Modular_multiplicative_inverse" title="Modular multiplicative inverse">multiplicative inverse</a>, if and only if <span class="texhtml"><i>m</i></span> is <a href="Prime_number" title="Prime number">prime</a>. If <span class="texhtml"><i>m</i> = <i>p</i><span style="padding-left:0.12em;"><sup><i>k</i></sup></span></span> is a <a href="Prime_power" title="Prime power">prime power</a> with <span class="texhtml"><i>k</i> > 1</span>, there exists a unique (up to isomorphism) finite field <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathrm {GF} (m)=\mathbb {F} _{m}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">G</mi>
<mi mathvariant="normal">F</mi>
</mrow>
<mo stretchy="false">(</mo>
<mi>m</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">F</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathrm {GF} (m)=\mathbb {F} _{m}}</annotation>
</semantics>
</math></span><img src="./8717eb7ee202b16ce677e20f835b6ea5370fe792.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.386ex; height:2.843ex;" alt="{\displaystyle \mathrm {GF} (m)=\mathbb {F} _{m}}" loading="lazy"></span> with <span class="texhtml"><i>m</i></span> elements, which is <i>not</i> isomorphic to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbb {Z} /m\mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbb {Z} /m\mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./6fef120a86ce66f277c2cebb01f9c4c14de784de.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.304ex; height:2.843ex;" alt="{\displaystyle \mathbb {Z} /m\mathbb {Z} }" loading="lazy"></span>, which fails to be a field because it has <a href="Zero-divisor" class="mw-redirect" title="Zero-divisor">zero-divisors</a>.
</p><p>If <span class="texhtml"><i>m</i> > 1</span>, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (\mathbb {Z} /m\mathbb {Z} )^{\times }}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mi>m</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo>×<!-- × --></mo>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (\mathbb {Z} /m\mathbb {Z} )^{\times }}</annotation>
</semantics>
</math></span><img src="./eb072a4530d1efb370e5fd8e5c7cc0e03272ed2f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.624ex; height:2.843ex;" alt="{\displaystyle (\mathbb {Z} /m\mathbb {Z} )^{\times }}" loading="lazy"></span> denotes the <a href="Multiplicative_group_of_integers_modulo_n" title="Multiplicative group of integers modulo n">multiplicative group of the integers modulo <span class="texhtml"><i>m</i></span></a> that are invertible. It consists of the congruence classes <span class="texhtml"><span style="text-decoration:overline;"><i>a</i></span><sub><i>m</i></sub></span>, where <span class="texhtml"><i>a</i></span> <a href="Coprime_integers" title="Coprime integers">is coprime</a> to <span class="texhtml"><i>m</i></span>; these are precisely the classes possessing a multiplicative inverse. They form an <a href="Abelian_group" title="Abelian group">abelian group</a> under multiplication; its order is <span class="texhtml"><i>φ</i>(<i>m</i>)</span>, where <span class="texhtml mvar" style="font-style:italic;">φ</span> is <a href="Euler's_totient_function" title="Euler's totient function">Euler's totient function</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Applications">Applications</h2></div>
<p>In pure mathematics, modular arithmetic is one of the foundations of <a href="Number_theory" title="Number theory">number theory</a>, touching on almost every aspect of its study, and it is also used extensively in <a href="Group_theory" title="Group theory">group theory</a>, <a href="Ring_theory" title="Ring theory">ring theory</a>, <a href="Knot_theory" title="Knot theory">knot theory</a>, and <a href="Abstract_algebra" title="Abstract algebra">abstract algebra</a>. In applied mathematics, it is used in <a href="Computer_algebra" title="Computer algebra">computer algebra</a>, <a href="Cryptography" title="Cryptography">cryptography</a>, <a href="Computer_science" title="Computer science">computer science</a>, <a href="Chemistry" title="Chemistry">chemistry</a> and the <a href="Visual_arts" title="Visual arts">visual</a> and <a href="Music" title="Music">musical</a> arts.
</p><p>A very practical application is to calculate checksums within serial number identifiers. For example, <a href="International_Standard_Book_Number" class="mw-redirect" title="International Standard Book Number">International Standard Book Number</a> (ISBN) uses modulo 11 (for 10-digit ISBN) or modulo 10 (for 13-digit ISBN) arithmetic for error detection. Likewise, <a href="International_Bank_Account_Number" title="International Bank Account Number">International Bank Account Numbers</a> (IBANs) use modulo 97 arithmetic to spot user input errors in bank account numbers. In chemistry, the last digit of the <a href="CAS_registry_number" class="mw-redirect" title="CAS registry number">CAS registry number</a> (a unique identifying number for each chemical compound) is a <a href="Check_digit" title="Check digit">check digit</a>, which is calculated by taking the last digit of the first two parts of the CAS registry number times 1, the previous digit times 2, the previous digit times 3 etc., adding all these up and computing the sum modulo 10.
</p><p>In cryptography, modular arithmetic directly underpins <a href="Public-key_cryptography" title="Public-key cryptography">public key</a> systems such as <a href="RSA_(algorithm)" class="mw-redirect" title="RSA (algorithm)">RSA</a> and <a href="Diffie%E2%80%93Hellman_key_exchange" title="Diffie–Hellman key exchange">Diffie–Hellman</a>, and provides <a href="Finite_field" title="Finite field">finite fields</a> which underlie <a href="Elliptic_curve" title="Elliptic curve">elliptic curves</a>, and is used in a variety of <a href="Symmetric_key_algorithm" class="mw-redirect" title="Symmetric key algorithm">symmetric key algorithms</a> including <a href="Advanced_Encryption_Standard" title="Advanced Encryption Standard">Advanced Encryption Standard</a> (AES), <a href="International_Data_Encryption_Algorithm" title="International Data Encryption Algorithm">International Data Encryption Algorithm</a> (IDEA), and <a href="RC4" title="RC4">RC4</a>. RSA and Diffie–Hellman use <a href="Modular_exponentiation" title="Modular exponentiation">modular exponentiation</a>.
</p><p>In computer algebra, modular arithmetic is commonly used to limit the size of integer coefficients in intermediate calculations and data. It is used in <a href="Polynomial_factorization" class="mw-redirect" title="Polynomial factorization">polynomial factorization</a>, a problem for which all known efficient algorithms use modular arithmetic. It is used by the most efficient implementations of <a href="Polynomial_greatest_common_divisor" title="Polynomial greatest common divisor">polynomial greatest common divisor</a>, exact <a href="Linear_algebra" title="Linear algebra">linear algebra</a> and <a href="Gr%C3%B6bner_basis" title="Gröbner basis">Gröbner basis</a> algorithms over the integers and the rational numbers. As posted on <a href="Fidonet" class="mw-redirect" title="Fidonet">Fidonet</a> in the 1980s and archived at <a href="Rosetta_Code" title="Rosetta Code">Rosetta Code</a>, modular arithmetic was used to disprove <a href="Euler's_sum_of_powers_conjecture" title="Euler's sum of powers conjecture">Euler's sum of powers conjecture</a> on a <a href="Sinclair_QL" title="Sinclair QL">Sinclair QL</a> <a href="Microcomputer" title="Microcomputer">microcomputer</a> using just one-fourth of the integer precision used by a <a href="CDC_6600" title="CDC 6600">CDC 6600</a> <a href="Supercomputer" title="Supercomputer">supercomputer</a> to disprove it two decades earlier via a <a href="Brute_force_search" class="mw-redirect" title="Brute force search">brute force search</a>.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>
</p><p>In computer science, modular arithmetic is often applied in <a href="Bitwise_operation" title="Bitwise operation">bitwise operations</a> and other operations involving fixed-width, cyclic <a href="Data_structure" title="Data structure">data structures</a>. The modulo operation, as implemented in many <a href="Programming_language" title="Programming language">programming languages</a> and <a href="Calculator" title="Calculator">calculators</a>, is an application of modular arithmetic that is often used in this context. The logical operator <a href="XOR" class="mw-redirect" title="XOR">XOR</a> sums 2 bits, modulo 2.
</p><p>The use of <a href="Long_division" title="Long division">long division</a> to turn a fraction into a <a href="Repeating_decimal" title="Repeating decimal">repeating decimal</a> in any base b is equivalent to modular multiplication of b modulo the denominator. For example, for decimal, b = 10.
</p><p>In music, arithmetic modulo 12 is used in the consideration of the system of <a href="Twelve-tone_equal_temperament" class="mw-redirect" title="Twelve-tone equal temperament">twelve-tone equal temperament</a>, where <a href="Octave" title="Octave">octave</a> and <a href="Enharmonic" class="mw-redirect" title="Enharmonic">enharmonic</a> equivalency occurs (that is, pitches in a 1:2 or 2:1 ratio are equivalent, and C-<a href="Sharp_(music)" title="Sharp (music)">sharp</a> is considered the same as D-<a href="Flat_(music)" title="Flat (music)">flat</a>).
</p><p>The method of <a href="Casting_out_nines" title="Casting out nines">casting out nines</a> offers a quick check of decimal arithmetic computations performed by hand. It is based on modular arithmetic modulo 9, and specifically on the crucial property that 10 ≡ 1 (mod 9).
</p><p>Arithmetic modulo 7 is used in algorithms that determine the day of the week for a given date. In particular, <a href="Zeller's_congruence" title="Zeller's congruence">Zeller's congruence</a> and the <a href="Doomsday_algorithm" class="mw-redirect" title="Doomsday algorithm">Doomsday algorithm</a> make heavy use of modulo-7 arithmetic.
</p><p>More generally, modular arithmetic also has application in disciplines such as <a href="Law" title="Law">law</a> (e.g., <a href="Apportionment_(politics)" title="Apportionment (politics)">apportionment</a>), <a href="Economics" title="Economics">economics</a> (e.g., <a href="Game_theory" title="Game theory">game theory</a>) and other areas of the <a href="Social_science" title="Social science">social sciences</a>, where <a href="Proportional_(fair_division)" class="mw-redirect" title="Proportional (fair division)">proportional</a> division and allocation of resources plays a central part of the analysis.
</p>
<div class="mw-heading mw-heading2"><h2 id="Computational_complexity">Computational complexity</h2></div>
<p>Since modular arithmetic has such a wide range of applications, it is important to know how hard it is to solve a system of congruences. A linear system of congruences can be solved in <a href="Polynomial_time" class="mw-redirect" title="Polynomial time">polynomial time</a> with a form of <a href="Gaussian_elimination" title="Gaussian elimination">Gaussian elimination</a>, for details see <a href="Linear_congruence_theorem" class="mw-redirect" title="Linear congruence theorem">linear congruence theorem</a>. Algorithms, such as <a href="Montgomery_reduction" class="mw-redirect" title="Montgomery reduction">Montgomery reduction</a>, also exist to allow simple arithmetic operations, such as multiplication and <a href="Modular_exponentiation" title="Modular exponentiation">exponentiation modulo <span class="texhtml"><i>m</i></span></a>, to be performed efficiently on large numbers.
</p><p>Some operations, like finding a <a href="Discrete_logarithm" title="Discrete logarithm">discrete logarithm</a> or a <a href="Quadratic_congruences" class="mw-redirect" title="Quadratic congruences">quadratic congruence</a> appear to be as hard as <a href="Integer_factorization" title="Integer factorization">integer factorization</a> and thus are a starting point for <a href="Cryptography" title="Cryptography">cryptographic algorithms</a> and <a href="Encryption" title="Encryption">encryption</a>. These problems might be <a href="NP-intermediate" title="NP-intermediate">NP-intermediate</a>.
</p><p>Solving a system of non-linear modular arithmetic equations is <a href="NP-complete" class="mw-redirect" title="NP-complete">NP-complete</a>.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1184024115">
/* start https://en.wikipedia.org/ */
.mw-parser-output .div-col{margin-top:0.3em;column-width:30em}.mw-parser-output .div-col-small{font-size:90%}.mw-parser-output .div-col-rules{column-rule:1px solid #aaa}.mw-parser-output .div-col dl,.mw-parser-output .div-col ol,.mw-parser-output .div-col ul{margin-top:0}.mw-parser-output .div-col li,.mw-parser-output .div-col dd{page-break-inside:avoid;break-inside:avoid-column}
/* end https://en.wikipedia.org/ */
</style><div class="div-col" style="column-width: 25em;">
<ul><li><a href="Boolean_ring" title="Boolean ring">Boolean ring</a></li>
<li><a href="Circular_buffer" title="Circular buffer">Circular buffer</a></li>
<li><a href="Division_(mathematics)" title="Division (mathematics)">Division (mathematics)</a></li>
<li><a href="Finite_field" title="Finite field">Finite field</a></li>
<li><a href="Legendre_symbol" title="Legendre symbol">Legendre symbol</a></li>
<li><a href="Modular_exponentiation" title="Modular exponentiation">Modular exponentiation</a></li>
<li><a href="Modulo_(mathematics)" title="Modulo (mathematics)">Modulo (mathematics)</a></li>
<li><a href="Multiplicative_group_of_integers_modulo_n" title="Multiplicative group of integers modulo n">Multiplicative group of integers modulo n</a></li>
<li><a href="Pisano_period" title="Pisano period">Pisano period</a> (Fibonacci sequences modulo <i>n</i>)</li>
<li><a href="Primitive_root_modulo_n" title="Primitive root modulo n">Primitive root modulo n</a></li>
<li><a href="Quadratic_reciprocity" title="Quadratic reciprocity">Quadratic reciprocity</a></li>
<li><a href="Quadratic_residue" title="Quadratic residue">Quadratic residue</a></li>
<li><a href="Rational_reconstruction_(mathematics)" title="Rational reconstruction (mathematics)">Rational reconstruction (mathematics)</a></li>
<li><a href="Reduced_residue_system" title="Reduced residue system">Reduced residue system</a></li>
<li><a href="Serial_number_arithmetic" title="Serial number arithmetic">Serial number arithmetic</a> (a special case of modular arithmetic)</li>
<li><a href="Two-element_Boolean_algebra" title="Two-element Boolean algebra">Two-element Boolean algebra</a></li>
<li>Topics relating to the group theory behind modular arithmetic:
<ul><li><a href="Cyclic_group" title="Cyclic group">Cyclic group</a></li>
<li><a href="Multiplicative_group_of_integers_modulo_n" title="Multiplicative group of integers modulo n">Multiplicative group of integers modulo n</a></li></ul></li>
<li>Other important theorems relating to modular arithmetic:
<ul><li><a href="Carmichael_function" title="Carmichael function">Carmichael's theorem</a></li>
<li><a href="Chinese_remainder_theorem" title="Chinese remainder theorem">Chinese remainder theorem</a></li>
<li><a href="Euler's_theorem" title="Euler's theorem">Euler's theorem</a></li>
<li><a href="Fermat's_little_theorem" title="Fermat's little theorem">Fermat's little theorem</a> (a special case of Euler's theorem)</li>
<li><a href="Lagrange's_theorem_(group_theory)" title="Lagrange's theorem (group theory)">Lagrange's theorem</a></li>
<li><a href="Thue's_lemma" title="Thue's lemma">Thue's lemma</a></li></ul></li></ul>
</div>
<div class="mw-heading mw-heading2"><h2 id="Notes">Notes</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFSandor_LehoczkyRichard_Rusczky2006" class="citation book cs1">Sandor Lehoczky; Richard Rusczky (2006). David Patrick (ed.). <i>the Art of Problem Solving</i>. Vol. 1 (7 ed.). AoPS Incorporated. p. 44. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0977304566</bdi>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFWeisstein" class="citation web cs1">Weisstein, Eric W. <a rel="nofollow" class="external text" href="https://mathworld.wolfram.com/ModularArithmetic.html">"Modular Arithmetic"</a>. <i>Wolfram MathWorld</i>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20230714132828/https://mathworld.wolfram.com/ModularArithmetic.html">Archived</a> from the original on 2023-07-14<span class="reference-accessdate">. Retrieved <span class="nowrap">2020-08-12</span></span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><a href="#CITEREFPettofrezzoByrkit1970">Pettofrezzo & Byrkit (1970</a>, p. 90)</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><a href="#CITEREFLong1972">Long (1972</a>, p. 78)</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><a href="#CITEREFLong1972">Long (1972</a>, p. 85)</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Book%3A_Introduction_to_Algebraic_Structures_(Denton)/02%3A_Groups_I/2.03%3A_Integers_Modulo_n">"2.3: Integers Modulo n"</a>. <i>Mathematics LibreTexts</i>. 2013-11-16. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20210419035455/https://math.libretexts.org/Bookshelves/Abstract_and_Geometric_Algebra/Book%3A_Introduction_to_Algebraic_Structures_(Denton)/02%3A_Groups_I/2.03%3A_Integers_Modulo_n">Archived</a> from the original on 2021-04-19<span class="reference-accessdate">. Retrieved <span class="nowrap">2020-08-12</span></span>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text">Sengadir T., <i><a rel="nofollow" class="external text" href="https://books.google.com/books?id=nglisrt9IewC&pg=PA293&dq=%22Zn+is+generated+by+1%22">Discrete Mathematics and Combinatorics</a></i>, p. 293, at <a href="Google_Books" title="Google Books">Google Books</a></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://rosettacode.org/wiki/Euler%27s_sum_of_powers_conjecture#QL_SuperBASIC">"Euler's sum of powers conjecture"</a>. <i>rosettacode.org</i>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20230326025754/https://rosettacode.org/wiki/Euler%27s_sum_of_powers_conjecture#QL_SuperBASIC">Archived</a> from the original on 2023-03-26<span class="reference-accessdate">. Retrieved <span class="nowrap">2020-11-11</span></span>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite id="CITEREFGareyJohnson1979" class="citation book cs1">Garey, M. R.; Johnson, D. S. (1979). <span class="id-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://archive.org/details/computersintract0000gare"><i>Computers and Intractability, a Guide to the Theory of NP-Completeness</i></a></span>. W. H. Freeman. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0716710447</bdi>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<ul><li>John L. Berggren. <a rel="nofollow" class="external text" href="https://www.britannica.com/EBchecked/topic/920687/modular-arithmetic">"modular arithmetic"</a>. <a href="Encyclop%C3%A6dia_Britannica" title="Encyclopædia Britannica">Encyclopædia Britannica</a>.</li>
<li><cite id="CITEREFApostol1976" class="citation cs2"><a href="Tom_M._Apostol" title="Tom M. Apostol">Apostol, Tom M.</a> (1976), <i>Introduction to analytic number theory</i>, Undergraduate Texts in Mathematics, New York-Heidelberg: Springer-Verlag, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-0-387-90163-3</bdi>, <a href="MR_(identifier)" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://mathscinet.ams.org/mathscinet-getitem?mr=0434929">0434929</a>, <a href="Zbl_(identifier)" class="mw-redirect" title="Zbl (identifier)">Zbl</a> <a rel="nofollow" class="external text" href="https://zbmath.org/?format=complete&q=an:0335.10001">0335.10001</a></cite>. See in particular chapters 5 and 6 for a review of basic modular arithmetic.</li>
<li>Maarten Bullynck "<a rel="nofollow" class="external text" href="https://web.archive.org/web/20131102014013/http://www.kuttaka.org/Gauss_Modular.pdf">Modular Arithmetic before C.F. Gauss. Systematisations and discussions on remainder problems in 18th-century Germany</a>"</li>
<li><a href="Thomas_H._Cormen" title="Thomas H. Cormen">Thomas H. Cormen</a>, <a href="Charles_E._Leiserson" title="Charles E. Leiserson">Charles E. Leiserson</a>, <a href="Ronald_L._Rivest" class="mw-redirect" title="Ronald L. Rivest">Ronald L. Rivest</a>, and <a href="Clifford_Stein" title="Clifford Stein">Clifford Stein</a>. <i><a href="Introduction_to_Algorithms" title="Introduction to Algorithms">Introduction to Algorithms</a></i>, Second Edition. MIT Press and McGraw-Hill, 2001. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-262-03293-7</bdi>. Section 31.3: Modular arithmetic, pp. 862–868.</li>
<li><a rel="nofollow" class="external text" href="http://genealogy.math.ndsu.nodak.edu/id.php?id=3545">Anthony Gioia</a>, <i>Number Theory, an Introduction</i> Reprint (2001) Dover. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-486-41449-3</bdi>.</li>
<li><cite id="CITEREFLong1972" class="citation book cs1">Long, Calvin T. (1972). <i>Elementary Introduction to Number Theory</i> (2nd ed.). Lexington: <a href="D._C._Heath_and_Company" title="D. C. Heath and Company">D. C. Heath and Company</a>. <a href="LCCN_(identifier)" class="mw-redirect" title="LCCN (identifier)">LCCN</a> <a rel="nofollow" class="external text" href="https://lccn.loc.gov/77171950">77171950</a>.</cite></li>
<li><cite id="CITEREFPettofrezzoByrkit1970" class="citation book cs1">Pettofrezzo, Anthony J.; Byrkit, Donald R. (1970). <span class="id-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://archive.org/details/elementsofnumber0000pett"><i>Elements of Number Theory</i></a></span>. Englewood Cliffs: <a href="Prentice_Hall" title="Prentice Hall">Prentice Hall</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>9780132683005</bdi>. <a href="LCCN_(identifier)" class="mw-redirect" title="LCCN (identifier)">LCCN</a> <a rel="nofollow" class="external text" href="https://lccn.loc.gov/71081766">71081766</a>.</cite></li>
<li><cite id="CITEREFSengadir2009" class="citation book cs1">Sengadir, T. (2009). <i>Discrete Mathematics and Combinatorics</i>. Chennai, India: Pearson Education India. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-81-317-1405-8</bdi>. <a href="OCLC_(identifier)" class="mw-redirect" title="OCLC (identifier)">OCLC</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/oclc/778356123">778356123</a>.</cite></li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><cite class="citation cs2"><a rel="nofollow" class="external text" href="https://www.encyclopediaofmath.org/index.php?title=Congruence">"Congruence"</a>, <i><a href="Encyclopedia_of_Mathematics" title="Encyclopedia of Mathematics">Encyclopedia of Mathematics</a></i>, <a href="European_Mathematical_Society" title="European Mathematical Society">EMS Press</a>, 2001 [1994]</cite></li>
<li>In this <a rel="nofollow" class="external text" href="https://web.archive.org/web/20060101075602/http://britton.disted.camosun.bc.ca/modart/jbmodart.htm">modular art</a> article, one can learn more about applications of modular arithmetic in art.</li>
<li>An <a rel="nofollow" class="external text" href="https://web.archive.org/web/20160220061222/http://mersennewiki.org/index.php/Modular_arithmetic">article</a> on modular arithmetic on the GIMPS wiki</li>
<li><a rel="nofollow" class="external text" href="http://www.cut-the-knot.org/blue/Modulo.shtml">Modular Arithmetic and patterns in addition and multiplication tables</a></li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Number_theory52" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2" style="background:#ffb;"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div id="Number_theory52" style="font-size:114%;margin:0 4em"><a href="Number_theory" title="Number theory">Number theory</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%;background:#ffd;">Fields</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Algebraic_number_theory" title="Algebraic number theory">Algebraic number theory</a> (<a href="Class_field_theory" title="Class field theory">class field theory</a>, <a href="Non-abelian_class_field_theory" title="Non-abelian class field theory">non-abelian class field theory</a>, <a href="Iwasawa_theory" title="Iwasawa theory">Iwasawa theory</a>, <a href="Iwasawa%E2%80%93Tate_theory" class="mw-redirect" title="Iwasawa–Tate theory">Iwasawa–Tate theory</a>, <a href="Kummer_theory" title="Kummer theory">Kummer theory</a>)</li>
<li><a href="Analytic_number_theory" title="Analytic number theory">Analytic number theory</a> (<a href="L-function" title="L-function">analytic theory of L-functions</a>, <a href="Probabilistic_number_theory" title="Probabilistic number theory">probabilistic number theory</a>, <a href="Sieve_theory" title="Sieve theory">sieve theory</a>)</li>
<li><a href="Geometry_of_numbers" title="Geometry of numbers">Geometric number theory</a></li>
<li><a href="Computational_number_theory" title="Computational number theory">Computational number theory</a></li>
<li><a href="Transcendental_number_theory" title="Transcendental number theory">Transcendental number theory</a></li>
<li><a href="Diophantine_geometry" title="Diophantine geometry">Diophantine geometry</a> (<a href="Arakelov_theory" title="Arakelov theory">Arakelov theory</a>, <a href="Hodge%E2%80%93Arakelov_theory" title="Hodge–Arakelov theory">Hodge–Arakelov theory</a>)</li>
<li><a href="Arithmetic_combinatorics" title="Arithmetic combinatorics">Arithmetic combinatorics</a> (<a href="Additive_number_theory" title="Additive number theory">additive number theory</a>)</li>
<li><a href="Arithmetic_geometry" title="Arithmetic geometry">Arithmetic geometry</a> (<a href="Anabelian_geometry" title="Anabelian geometry">anabelian geometry</a>, <a href="P-adic_Hodge_theory" title="P-adic Hodge theory">p-adic Hodge theory</a>)</li>
<li><a href="Arithmetic_topology" title="Arithmetic topology">Arithmetic topology</a></li>
<li><a href="Arithmetic_dynamics" title="Arithmetic dynamics">Arithmetic dynamics</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%;background:#ffd;">Key concepts</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Number" title="Number">Numbers</a></li>
<li><a href="0" title="0">0</a></li>
<li><a href="Natural_number" title="Natural number">Natural numbers</a></li>
<li><a href="1" title="1">Unity</a></li>
<li><a href="Prime_number" title="Prime number">Prime numbers</a></li>
<li><a href="Composite_number" title="Composite number">Composite numbers</a></li>
<li><a href="Rational_number" title="Rational number">Rational numbers</a></li>
<li><a href="Irrational_number" title="Irrational number">Irrational numbers</a></li>
<li><a href="Algebraic_number" title="Algebraic number">Algebraic numbers</a></li>
<li><a href="Transcendental_number" title="Transcendental number">Transcendental numbers</a></li>
<li><a href="P-adic_number" title="P-adic number">p-adic numbers</a> (<a href="P-adic_analysis" title="P-adic analysis">p-adic analysis</a>)</li>
<li><a href="Arithmetic" title="Arithmetic">Arithmetic</a></li>
<li><a href="Chinese_remainder_theorem" title="Chinese remainder theorem">Chinese remainder theorem</a></li>
<li><a href="Arithmetic_function" title="Arithmetic function">Arithmetic functions</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%;background:#ffd;">Advanced concepts</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Quadratic_form" title="Quadratic form">Quadratic forms</a></li>
<li><a href="Modular_form" title="Modular form">Modular forms</a></li>
<li><a href="L-function" title="L-function">L-functions</a></li>
<li><a href="Diophantine_equation" title="Diophantine equation">Diophantine equations</a></li>
<li><a href="Diophantine_approximation" title="Diophantine approximation">Diophantine approximation</a></li>
<li><a href="Irrationality_measure" title="Irrationality measure">Irrationality measure</a></li>
<li><a href="Simple_continued_fraction" title="Simple continued fraction">Simple continued fractions</a></li></ul>
</div></td></tr><tr><td colspan="2" class="navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><span class="noviewer" typeof="mw:File"><span title="Category"></span></span> Category</li>
<li><span class="noviewer" typeof="mw:File"><span title="List-Class article"></span></span> <a href="List_of_number_theory_topics" title="List of number theory topics">List of topics</a></li>
<li><span class="noviewer" typeof="mw:File"><span title="List-Class article"></span></span> <a href="List_of_recreational_number_theory_topics" title="List of recreational number theory topics">List of recreational topics</a></li>
<li><span class="noviewer" typeof="mw:File"></span> <a href="https://en.wikibooks.org/wiki/Number_Theory" class="extiw external" title="wikibooks:Number Theory">Wikibook</a></li>
<li><span class="noviewer" typeof="mw:File"></span> <a href="https://en.wikiversity.org/wiki/Number_Theory" class="extiw external" title="wikiversity:Number Theory">Wikiversity</a></li></ul>
</div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-20" href="https://en.wikipedia.org/wiki/?title=Modular_arithmetic&oldid=1301638877">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>